#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
using namespace std;
const int maxn=105;
struct node
{
    double a,l,p,c,d;
    node(double _a=0.0,double _l=0.0,double _p=0.0):a(_a),l(_l),p(_p)
    {c=1-l+l*p;d=a*p;}
    bool operator <(const node &r)const{return d*r.c+r.d>r.d*c+d;}
};
node ga[maxn];
double dp[maxn][maxn];

int main()
{
    freopen("abc.txt","r",stdin);
    int n,k;
    double x0;
    while(scanf("%d%d%lf",&n,&k,&x0),n)
    {
        int nw=0,nl=0;
        for(int i=1;i<=n;i++)
        {
            double ta,tl,tp;
            scanf("%lf%lf%lf",&ta,&tl,&tp);
            ga[i]=node(ta,tl/100.0,tp/100.0);
        }
        memset(dp,0,sizeof dp);
        sort(ga+1,ga+1+n);
        for (int i=1; i<=n; ++i) cout<<ga[i].c<<" "<<ga[i].d<<endl;
        for(int i=0;i<=n;i++)dp[i][0]=x0;
        for(int i=1;i<=n;i++)
        {
            int s=min(k,i);
            double c=ga[i].c,d=ga[i].d;
            for(int j=1;j<=s;j++)
            {
                if(j==i)    dp[i][j]=c*dp[i-1][j-1]+d;
                else
                {
                    dp[i][j]=max(dp[i-1][j],c*dp[i-1][j-1]+d);
                }
            }
        }
        for (int i=1; i<=k; ++i){
        	for (int j=1; j<=n; ++j) cout<<dp[j][i]<<" ";
        	cout<<endl;
		}
        printf("%.2lf\n",dp[n][k]);
    }
    return 0;
}
